<?php
$q=$_GET["q"];

	require_once('config.php');
	$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
	if(!$link) {
		die('Failed to connect to server: ' . mysql_error());
	}
	
	//Select database
	$db = mysql_select_db(DB_DATABASE);
	if(!$db) {
		die("Unable to select database");
	}


$sql="SELECT * FROM members WHERE member_id = '".$q."'";

$result = mysql_query($sql);

echo "<table border='1'>
<tr>
<th>member_id</th>
<th>name</th>
<th>login</th>
<th>passwd</th>
</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['member_id'] . "</td>";
  echo "<td>" . $row['name'] . "</td>";
  echo "<td>" . $row['login'] . "</td>";
  echo "<td>" . $row['passwd'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

mysql_close($link);
?>